import Vue from 'vue'
import Router from 'vue-router'

import evaluation from '@/views/GBA/index'; // 测评

import room from '@/views/GBA/room/index'
Vue.use(Router);

export default new Router({
  mode: 'history',
  routes: [
    {
      // 首页--介绍页
      path: '/',
      name: 'Index',
      component: () => import('./../views/index.vue')
    },
    {
      // 登录
      path: '/userlogin',
      name: 'LoginIndex',
      component: () => import("./../views/Login/login.vue")
    },
    {
      // 忘记密码--找回
      path: '/forgetpwd',
      name: 'ForgetPwdIndex',
      component: () => import("./../views/Login/forget.vue")
    },
    {
      path: '/personal',
      name: 'personal',
      component: ()=>import('./../views/GBA/result/results.vue')
    },
    {
      path: '/room',
      name: 'Room',
      component: room
    },
    {
      // 联系我们
      path: '/contact',
      name: 'Contact',
      component: ()=>import('./../views/AboutPages/contact.vue')
    },
    {
      // 测评结果的显示页面
      path: '/result',
      name: 'Result',
      component: ()=>import('./../views/GBA/result/results.vue')
    },
    {
      // 一些静态的描述文件
      path: '/desc',
      name: 'desc',
      component: ()=>import('./../views/AboutPages/describe.vue')
    },
    {
      // 测评
      path: '/evaluation',
      name: 'evaluation',
      component: evaluation
    },
    {
      // 用户登录后的用户中心
      path: '/user',
      name: 'User',
      component: () => import('./../views/UserCenter/index.vue'),
      children: [
        {
          // 首页--介绍页
          path: '/',
          name: 'UserIndex',
          component: () => import('./../views/UserCenter/MainPanel/index.vue')
        },
        {
          // 首页--介绍页
          path: '/user/admin',
          name: 'UserIndex',
          component: () => import('./../views/UserCenter/Admin/index.vue')
        },
        {
          // 设置
          path: '/user/setting',
          name: 'UserSetting',
          component: () => import('./../views/UserCenter/UserInfo/userinfo.vue'),
        },
      ]
    },
    {
      // 404-没找到
      path: '*',
      name: 'nofound',
      component: () => import('./../views/404/404page.vue')
    }
  ]
})
